﻿<div class="wrap reader-con">

    <!--面包屑一-->
    <div class="crumbLink"><a href="javascript:void(0);">首页</a>&gt;<a href="javascript:void(0);">文献在线阅读</a></div>

    <!-- read-containerSTART -->
    <div class="m-s-top clearfix">
        <h1 class='online-h1-24'></h1>
    </div>
    <div class="reader-container posr" style='height: 837px;'>
        <div class="r-c-r posa" id="reader">
        </div>
    </div>
    <!-- end read-container -->
</div>
<!--内容==结束-->
<!--  工具条 -->
<iframe style="bottom: 0; left: 0; position: fixed; border: none; text-align: left; width: 100%; z-index: 1000; background-color: white; height: 46px;"></iframe>
<div class="reader-tools-bar-wrap">
    <div class="reader-tools-bar clearfix">
        <div class="fl">
            <div class="shareTitle fl">
                @*                <div class="fl">
                    分享：
                </div>
                <a class="" title="分享到新浪微博" href="javascript:void(0);"><i class="iconfont icon-sinaWB"></i></a>
                <a class="" title="分享到微信" href="javascript:void(0);"><i class="iconfont icon-weixin02"></i></a>*@

            </div>

        </div>
        <div class="center clearfix pt10 fl">
            @*<a class="btn btn-m btn-warn-f fl" href="javascript:void(0);">下载到E-learning</a>*@
            <div hidefocus="true" class="reader-tools-btn1-wrap centerLeft fl">
                <a href="javascript:small();" title="缩小" class="ic zoom-out fl"></a>
               @* <ul class="times fl mt5">
                    <li>120%<i class="caretNav caret-dw"></i><>
                    <li>110%<i class="caretNav caret-dw"></i><> 
                    <li>100%<i class="caretNav caret-dw"></i></li>
                    <li>90%<i class="caretNav caret-dw"></i><>
                    <li>80%<i class="caretNav caret-dw"></i><>

                </ul>*@
                <input class="f-text span1 fl" style="padding: 2px 0 2px 3px;margin-top: 3px" id="inputradio" name="inputradio" type="text" />
                <a href="javascript:big();" title="放大" class="ic zoom-in fl"></a>
            </div>
            <div hidefocus="true" class="reader-tools-btn2-wrap centerLeft posa" style='margin: 0;'>
                <a href="javascript:prepage();" title="上一页" class="ic prev-page fl"></a>
                <input class="f-text span1 fl" type="text" value="1" id="curPage" name="curPage" onkeypress="return jumpPage(event)">/<span id="pageCount" name="pageCount">10</span>
                <a href="javascript:nextpage();" title="下一页" class="ic next-page ml5 fr"></a>
            </div>
            <div style='top: 13px;' class="fr">
                <input class="f-text span1 fl" style="padding: 2px 0 2px 3px;margin-top: 3px;width: 150px;" value="" id="searchQuery" name="searchQuery" type="text" />
                <a href="javascript:search();">检索</a>
            </div>

        </div>
        @*<div class="right clearfix pt10 fr">
            <a class="btn btn-m btn-warn-f" href="@ViewBag.Download">下载该资源</a>
                        <a class="btn btn-m btn-prim-f" href="@ViewBag.DownloadPDF">下载PDF</a>
        </div>*@

    </div>
</div>
<!--  工具条END -->



<script type="text/javascript">
    $(document).ready(function () {
        if ("@ViewBag.IsFileExsit" == "False") {
            messageAlert('请求的资源不存在');
            window.close();
            return;
        }
        if ((navigator.userAgent.indexOf('MSIE') >= 0 || navigator.userAgent.indexOf('rv:11') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)) {
            $("#reader").html("<object codebase='http://update.cnki.net/activex/cajax.cab#version=3,0,457,0' classid='clsid:78E87ACB-656E-4257-961D-3FADBE77A626' width='1197' height='783' id='cajax' name='cajax'>" +
                    "<param name='ShowToolBar' value='0' />" + "<param name='ShowLeftBar' value='0' /><param name='ShowBottomBar' value='0' /><param name='ShowNoteAuthor' value='1' />" +
                    "<param name='ShowNoteTime' value='1' /><param name='CanEditNoteAuthor' value='1' /><param name='PageMode' value='0' /></object>")
        } else if (navigator.userAgent.indexOf('Firefox') >= 0) {
            $("#reader").html("<embed id='cajax' type='application/CNKI-CAJAX-plugin' width=1197 height=783>");
        }
        try {
            cajax.Open("@Html.Raw(@ViewBag.OnlineViewUrl)");
            $("#pageCount").text(cajax.GetPageCount());
        }
        catch (ee) {
            messageAlert("请先安装阅读插件!");
        }
    })

    function CAJAX_EVENT_OpenUrlCompleted() {
        $("#pageCount").text(cajax.GetPageCount());
        
        $("#inputradio").val(parseInt(cajax.ZoomRatio * 100)+"%");
        //curZoom = cajax.ZoomRatio;
    }

    function CAJAX_EVENT_PageChanged(index) {
        document.getElementById("curPage").value = index;
    }
    function CAJAX_EVENT_MouseMove(a, b, c, d, e) {

    }
    function CAJAX_EVENT_MouseWheel(a, b, c, d, e, f) {

    }
    function CAJAX_EVENT_SetHeight(a) {

    }
    function CAJAX_EVENT_PageSizeChanged(a) {

    }
    function prepage() {
        cajax.TurnToPage(0, 1);
    }

    function nextpage() {
        cajax.TurnToPage(0, 2);
    }

    function firstpage() {
        cajax.TurnToPage(0, 3);
    }

    function lastpage() {
        cajax.TurnToPage(0, 4);
    }
   
    function big() {
        var curZoom = cajax.ZoomRatio;
        curZoom += 0.1;
        cajax.Zoom(0, curZoom);
        $("#inputradio").val(parseInt(curZoom*100)+"%");
    }
    function small() {
        var curZoom = cajax.ZoomRatio;
        curZoom -= 0.1;
        cajax.Zoom(0, curZoom);
        $("#inputradio").val(parseInt(curZoom * 100) + "%");
    }
    function fullscreen() {
        cajax.FullScreen(true);
    }
    function jumpPage(e) {
        var keynum;

        if (window.event) // IE  
        {
            keynum = e.keyCode;

        }
        else if (e.which) // Netscape/Firefox/Opera  
        {
            keynum = e.which;
        }

        if (Number(keynum) == 13) {
            var pageNum = Number($('#curPage').val());
            var totalNum = Number($('#pageCount').text());
            if (pageNum > 0 && pageNum <= totalNum) {
                cajax.TurnToPage(pageNum, 0);
            }
            else {
                messageAlert("输入页数超过范围");
            }
        }
        return true;
    }
    var objresult;
    var currentIndex;
    var currentQuery;
    function search() {
        var searchQuery = $('#searchQuery').val();
        if ("" == searchQuery) {
            return;
        }
        if (searchQuery == currentQuery) {
            currentIndex++;
            if (objresult.count > currentIndex) {
                cajax.GotoSearchResult(currentIndex);
            }
            else {
                currentIndex = 0;
                cajax.GotoSearchResult(0);
            }
        }
        else {
            objresult = cajax.Search(searchQuery, 0);
            cajax.GotoSearchResult(0);
            currentIndex = 0;
            currentQuery = searchQuery;
        }
    }
</script>

<script for="cajax" event="PageChanged(index)" language="javascript">
    document.getElementById("curPage").value = index;
</script>

<script for="cajax" event="OpenUrlCompleted()" language="javascript" type="text/javascript">
    $("#pageCount").text(cajax.GetPageCount());
    $("#inputradio").val(parseInt(cajax.ZoomRatio * 100) + "%");
    //curZoom = cajax.ZoomRatio;
</script>

